<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
    <head>
        <meta charset="UTF-8" />
        <title><?php echo $title; ?></title>
        <base href="<?php echo $base; ?>" />
        <?php if ($description) { ?>
        <meta name="description" content="<?php echo $description; ?>" />
        <?php } ?>
        <?php if ($keywords) { ?>
        <meta name="keywords" content="<?php echo $keywords; ?>" />
        <?php } ?>
        <?php if ($icon) { ?>
        <link href="<?php echo $icon; ?>" rel="icon" />
        <?php } ?>
        <?php foreach ($links as $link) { ?>
        <link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
        <?php } ?>
        <link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
        <link href="catalog/view/theme/default/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="catalog/view/theme/default/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
        <link href="catalog/view/theme/default/css/style.css" rel="stylesheet" type="text/css" />
        <?php foreach ($styles as $style) { ?>
        <link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
        <?php } ?>
        <link href="catalog/view/theme/default/css/sp-chi-tiet.css" rel="stylesheet" type="text/css" />
        <link href="catalog/view/theme/default/css/san-pham.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
        <script src="catalog/view/javascript/bootstrap.min.js" type="text/javascript"></script>
        <script src="catalog/view/javascript/smoothproducts.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="catalog/view/javascript/common.js"></script>
        <!-- Autofill search -->
        <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/livesearch.css" />
        <script src="catalog/view/javascript/jquery/livesearch.js"></script>
        <script src="catalog/view/javascript/jquery/jquery.elevateZoom-3.0.8.min.js" type="text/javascript"></script>
        <!-- Autofill search END -->
        <script src="catalog/view/javascript/script.js" type="text/javascript"></script>
        <?php foreach ($scripts as $script) { ?>
        <script type="text/javascript" src="<?php echo $script; ?>"></script>
        <?php } ?>
        <?php echo $google_analytics; ?>
    </head>
    <body>
        <div id="page">
            <div id="header">
                <?php //echo $language; ?>
                <?php //echo $currency; ?>
                <?php //echo $cart; ?>
                <!-- <div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>-->
                <div class="top">
                    <div class="bar-top">
                        <span class="wel">
                            <?php if (!$logged) { ?>
                            <?php echo $text_welcome; ?>
                            <?php } else { ?>
                            <?php echo $text_logged; ?>
                            <?php } ?>
                        </span>
                        <div class="dropdown menu-t">
                            <a data-toggle="dropdown" href="#" class="a-t"><img src="catalog/view/theme/default/images/gb.png" class="img-t"/><span class="caret"></span></a>
                            <ul class="dropdown-menu drop-memu" role="menu" aria-labelledby="dLabel">
                                <li class="m-con"><a href="#"> <img src="catalog/view/theme/default/images/gb.png" /></a></li>
                                <li class="m-con"><a href="#"> <img src="catalog/view/theme/default/images/eg.png" /></a></li>
                            </ul>
                        </div>
                        <div class="dropdown menu-t">
                            <a data-toggle="dropdown" href="#" class="a-h">VND<span class="caret"></span></a>
                            <ul class="dropdown-menu drop-memu" role="menu" aria-labelledby="dLabel">

                                <li class="t-con">
                                    <?php
                                        echo $currency;
                                     ?>
                                </li>
                                <!--<li class="t-con"><a href="#">&yen;</a></li>
                                <li class="t-con"><a href="#">$</a></li>-->
                            </ul>
                        </div>
                        <div class="dropdown menu-t">
                            <a data-toggle="dropdown" href="#" class="a-h">Links<span class="caret"></span></a>
                            <ul class="dropdown-menu drop-memu" role="menu" aria-labelledby="dLabel">
                                <li class="t-con"><a href="#">Links</a></li>
                                <li class="t-con"><a href="#">Wish List (0)</a></li>
                                <li class="t-con"><a href="#">My Account</a></li>
                                <li class="t-con"><a href="#">Shopping Cart</a></li>
                                <li class="t-con"><a href="#">Checkout</a></li>
                                <li class="t-con"><a href="#">Contact Us</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="bar-call">
                    <a href="#" class="a-call">
                        <div class="box-call">
                            <img src="catalog/view/theme/default/images/cart--.png" />
                            <div class="text-call">
                                <h4 class="title-call">FAST SHIPPING</h4>
                                <span class="span-title">Get you every where</span>
                            </div>
                        </div>
                    </a>
                    <a href="#" class="a-call">
                        <div class="box-call">
                            <img src="catalog/view/theme/default/images/1395549277_phone--.png" />
                            <div class="text-call">
                                <h4 class="title-call">CALL US</h4>
                                <span class="span-title">010653251485</span>
                            </div>
                        </div>
                    </a>
                    <a href="#" class="a-call">
                        <div class="box-call">
                            <img src="catalog/view/theme/default/images/1395549269_lock-closed-outline--.png" />
                            <div class="text-call">
                                <h4 class="title-call">SECURE STORE</h4>
                                <span class="span-title">100% Secure store</span>
                            </div>
                        </div>
                    </a>
                    <a href="#" class="a-call">
                        <div class="box-call">
                            <img src="catalog/view/theme/default/images/1395549271_stopwatch--.png" />
                            <div class="text-call">
                                <h4 class="title-call">SAVE TIME</h4>
                                <span class="span-title">save your time</span>
                            </div>
                        </div>
                    </a>
                    <a href="#" class="a-call">
                        <div class="box-call">
                            <img src="catalog/view/theme/default/images/1395549274_shopping-cart--.png" />
                            <div class="text-call">
                                <h4 class="title-call">PAY ON DELIVERY</h4>
                                <span class="span-title">Pay when we come</span>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="bar-logo">
                    <a href="/"><img src="image/phukien_logo.png" class="logo"/></a>
                    <div id="search" class="search">
                        <input type="search" name="search" placeholder="<?php echo $text_search; ?>" autocomplete="off" value="<?php echo $search; ?>" />
                        <div class="dropdown menu-s">
                            <div class="search-pos">
                                <div class="search-bt"></div>
                                <input type="submit" class="sub-s" />
                            </div>
                            <ul class="dropdown-menu drop-memu" role="menu" aria-labelledby="dLabel">
                                <li class="t-con"><a href="?c=0">All</a></li>
                                <?php
                                foreach($categorieshot as $val){
                                ?>
                                <li class="t-con"><a href="?c=<?php echo $val['category_id'];?>"><?php echo $val['name']?></a></li>
                                <?php }?>
                            </ul>
                            <a data-toggle="dropdown" href="#" class="a-s">All<span class="caret"></span></a>
                        </div>
                    </div>
                    <a href="#" class="a-call">
                        <div class="gio-hang">
                            <div class="text-cart">
                                <h4 class="title-cart">PAY ON DELIVERY</h4>
                                <div class="dropdown menu-s c">
                                    <a data-toggle="dropdown" href="#" class="a-c">Giỏ hàng<span class="caret"></span></a>
                                    <ul class="dropdown-menu drop-memu" role="menu" aria-labelledby="dLabel">
                                        <?php echo $cart; ?>
                                    </ul>
                                </div>
                            </div>
                            <img src="catalog/view/theme/default/images/cart.png" class="img-cart"/>
                        </div>
                    </a>
                </div>
                <?php if ($categories) { ?>
                <div id="menu">
                    <ul>
                        <li class="home"><a href="/"><img style="width: 20px;" src="catalog/view/theme/default/images/home.png"/></a></li>
                        <?php foreach ($categories as $category) { ?>
                        <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
                            <?php if ($category['children']) { ?>
                            <div>
                                <?php for ($i = 0; $i < count($category['children']);) { ?>
                                <ul>
                                    <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
                                    <?php for (; $i < $j; $i++) { ?>
                                    <?php if (isset($category['children'][$i])) { ?>
                                    <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
                                    <?php } ?>
                                    <?php } ?>
                                </ul>
                                <?php } ?>
                            </div>
                            <?php } ?>
                        </li>
                        <?php } ?>
                    </ul>
                </div>
                <?php } ?>
                <!-- -->
            </div>
            <?php if ($error) { ?>
            <div class="warning"><?php echo $error ?><img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>
            <?php } ?>
            <div id="notification"></div>
